Repository navigation
RDE-1.12: migration guide from 0.6 to 1.0 - #197
Merged
Merged
Conversation
docs/migration.md shows every 0.x pattern next to its 1.0 code (ExcelFile + ExcelSheet + ExcelColumn, dataSet, xSteps/ySteps, hideElement, element, fileExtension, xlsx-style styles with a converter) and lists the intentional behaviour differences, checked against the v0.6.0 source. Every 1.0 snippet is a type-checked file in examples/migration; docs:check keeps the Markdown blocks identical to the files. README gains a Migrating from 0.x section.
# Conflicts: # README.md # packages/react-data-export/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RDE-1.12: the 0.6 → 1.0 migration guide, as
docs/migration.md, plus a "Migrating from 0.x" section in the README.What's in the guide
ExcelFile+ExcelSheet+ExcelColumn, includingvaluefunctionsdataSetwith array rows, styled cells and widthsxSteps/ySteps→blocks+offset+gap: 0. The second block of the 0.6 example lands at B9 in both versions (checked withfromDatasets).hideElement→useExcelExport+useEffectelement→ label or render propfileExtension/filename, including xls/txt/htmlfont.sz→font.size,fill.patternType/fgColor→fill,textRotation→rotation,readingOrder, string theme indexes,auto: 1,vertAlign, …). It comes with aconvertLegacyStyle()helper users can copy. All 13 style variants from the 0.6 docs convert and write withoutINVALID_STYLE.ExcelFile.js,DataUtil.js) and against the tempa-xlsx 0.0.1 source it pinned. Each entry says how to get the old output back where that makes sense:<ExcelColumn>headers weren't bold.dataSetheaders were, and a columnstylereplaced that.{ wpx: 80 }default width applied only to object columns indataSet, and the last block's widths won.write: { dateZone: 'utc' }restores the old behaviour.hideElementdownloaded in the constructor, so twice under StrictMode.report.xlsx.xlsx), and the default name wasDownload.elementwas wrapped in a<span onClick>.columns: []gave an empty header row. In 0.6.0, stringcolumnsgave empty header cells (the header code readscol.title).undefined,''andNaNbecame empty text cells.fileExtensioncsv/txt/xls/html never produced those formats. tempa-xlsx 0.0.1'swriteSynconly special-cases'xml', so every other book type went through its zip writer: 0.6 saved an xlsx package under a.csv/.txt/.xls/.htmlname. I found this by reading the source; I didn't run the package. 1.0'sformat: 'csv'is the first real CSV output, and the guide says so..xls,.htmland.txtformats,elementcloning, thehideElementprop,dataas a function, the default export, PropTypes.Type-checked snippets (like javascript-excel's docs:check)
examples/migration/(10 files). They're type-checked against the library source throughpaths, so no build is needed.scripts/check-doc-snippets.mjs(same convention as javascript-excel's:<!-- example: path -->+ fence;--fixrewrites the blocks) fails when a Markdown block differs from its file. I checked that a drifted block fails the step.npm run typechecknow also runstsc -p examples/migration, and a new step runsnpm run docs:check. I didn't addexamples/*as a workspace: its own React dependency would fightscripts/use-react.mjsin the React 17/18 jobs. No job was renamed. No changeset, because nothing in the published code changes.Scope
Only
docs/migration.md,examples/migration/,scripts/check-doc-snippets.mjs, the two READMEs, the rootpackage.jsonscripts and the CI step. Nothing indocs/api.mdorsrcchanges, since infra-rde is working there for RDE-1.17.StrictMode
The
hideElementrecipe gives one download under StrictMode, for xlsx and CSV. The CSV double download found while writing this guide was fixed in #198, which is merged into this branch. The guide records the 0.6 behaviour: it downloaded twice under StrictMode, because the download started in the constructor.Table export (RDE-1.17)
RDE-1.17 merged while this was open. After merging main, §3.8 "New: export a table that is already on the page" shows
<ExportTableButton tableRef>withdata-type/data-numfmthints (examples/migration/table-export.tsx), and there's a row for it in the quick reference. It's aimed at 0.x apps that rendered a<table>and passed the same rows to<ExcelFile>. 0.x had no table API, so this is a pointer rather than a migration. The merge itself only resolves the two README status lines: main's text, plus the migration link.